package it.appetite;

import it.appetite.member.BandMemberActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class BandActivity extends Activity {

	private BandActivity cxt;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.band);
        this.cxt = this;
        
        View.OnClickListener gestore = new View.OnClickListener() {
        	public void onClick(View view) { 

        		Intent intent = new Intent(cxt, MemberActivity.class);
        		
        		switch(view.getId()){

        		case R.id.bandImg:
        			intent = new Intent(cxt, BandMemberActivity.class);
        			break;

        		case R.id.voiceImg:
        			intent.putExtra("member", R.id.voiceImg);
        			break;
        			
        		case R.id.guitar1Img:
        			intent.putExtra("member", R.id.guitar1Img);
        			break;
        			
        		case R.id.guitar2Img:
        			intent.putExtra("member", R.id.guitar2Img);
        			break;
        			
        		case R.id.bassImg:
        			intent.putExtra("member", R.id.bassImg);
        			break;
        			
        		case R.id.drumImg:
        			intent.putExtra("member", R.id.drumImg);
        			break;
        			
        		case R.id.keyboardImg:
        			intent.putExtra("member", R.id.keyboardImg);
        			break;
        		}
        		
        		startActivity(intent);
        	}
        };
        
        ImageView bandImg = (ImageView) findViewById(R.id.bandImg);
        ImageView voiceImg = (ImageView) findViewById(R.id.voiceImg);
        ImageView guitar1Img = (ImageView) findViewById(R.id.guitar1Img);
        ImageView guitar2Img = (ImageView) findViewById(R.id.guitar2Img);
        ImageView bassImg = (ImageView) findViewById(R.id.bassImg);
        ImageView drumImg = (ImageView) findViewById(R.id.drumImg);
        ImageView keyboardImg = (ImageView) findViewById(R.id.keyboardImg);
        
        bandImg.setOnClickListener(gestore);
        voiceImg.setOnClickListener(gestore);
        guitar1Img.setOnClickListener(gestore);
        guitar2Img.setOnClickListener(gestore);
        bassImg.setOnClickListener(gestore);
        drumImg.setOnClickListener(gestore);
        keyboardImg.setOnClickListener(gestore);
    }
    
}
